(ql:quickload :parenscript)

(in-package "PARENSCRIPT")

(let ((files (directory "./lisp/*.lisp")))
  (dolist (file files)
    ;; (cl:load file)
    (let* ((file-name (pathname-name file))
           (js-file (concatenate 'string "./application/js/" file-name ".lisp.js"))
           (o-file (pathname js-file)))
      (format t "~a -> ~a" file o-file)
      (fresh-line)
      (with-open-file (output o-file
                              :direction :output
                              :if-exists :supersede
                              :if-does-not-exist :create)
        (write-string (ps-compile-file file) output)))))

(SB-EXT:EXIT)
